<?php

/**
 * essay actions.
 *
 * @package    quotes
 * @subpackage essay
 * @author     Your name here
 * @version    SVN: $Id: actions.class.php 23810 2009-11-12 11:07:44Z Kris.Wallsmith $
 */
class essayActions extends sfActions
{
 /**
  * Executes index action
  *
  * @param sfRequest $request A request object
  */
  public function executeIndex(sfWebRequest $request)
  {
    $this->essays = EssayQuery::create()
      ->joinWithAuthor()
      ->paginate(1, 10);
  }

  public function executeShow(sfWebRequest $request)
  {
    $this->essay = EssayQuery::create()->findOneBySlug($request->getParameter('slug'));
    $this->forward404Unless($this->essay);
    $this->author = $this->essay->getAuthor();
  }
}
